{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SVM处理二分类问题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 准备数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "iris = datasets.load_iris()\n",
    "\n",
    "X = iris.data\n",
    "y = iris.target\n",
    "\n",
    "X = X[y < 2, :2]\n",
    "y = y[y < 2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAF2pJREFUeJzt3X+MXWWdx/H3d4dZHH/ARJmsMC1OVk3/ELqWTkDSxLjgLv6opUFWSvxVw9pdowsGg9kaoqYxIaYJKmuiKZAFhEW7tXYLAVmUNf6INJkBbHetTdBF+4NdRrDFrrNsO3z3j3uHzty5M/c+997n3ud57ueVTObecx9Ov885+u3tOZ9zjrk7IiJSlj/qdQEiItJ5au4iIgVScxcRKZCau4hIgdTcRUQKpOYuIlIgNXcRkQKpuYuIFEjNXUSkQKc1O9DMBoAJ4LC7r635bCOwFThcXfRVd79tqfWdddZZPjY2FlSsiEi/m5yc/K27jzQa13RzB64D9gNnLPL5t9z9E82ubGxsjImJiYA/XkREzOzXzYxr6rCMmS0D3g0s+W1cRETS0Owx9y8DnwZeXGLMe81sr5ntMLPl9QaY2SYzmzCziampqdBaRUSkSQ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es>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 绘制决策区域\n",
    "def plot_decision_boundary(model, axis):\n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1] - axis[0]) * 100)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3] - axis[2]) * 100)).reshape(-1, 1)\n",
    "    )\n",
    "    \n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "    \n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "    \n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#FFCCCC', '#FFFF99', '#CCCCFF'])\n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 绘制决策区域\n",
    "def plot_svc_decision_boundary(model, axis):\n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1] - axis[0]) * 100)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3] - axis[2]) * 100)).reshape(-1, 1)\n",
    "    )\n",
    "    \n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "    \n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "    \n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#FFCCCC', '#FFFF99', '#CCCCFF'])\n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)\n",
    "    \n",
    "    \n",
    "    w = model.coef_[0]\n",
    "    b = model.intercept_[0]\n",
    "    \n",
    "    # 绘制svm的决策边界线和辅助线\n",
    "    # w0 * x0 + w1 * x1 + b = 0\n",
    "    # => x1 = (-w0 * x0 - b) / w1\n",
    "    plot_x = np.linspace(axis[0], axis[1], 200)\n",
    "    up_y = (-w[0] * plot_x - b + 1) / w[1]\n",
    "    down_y = (-w[0] * plot_x - b - 1) / w[1]\n",
    "    \n",
    "    # up_y和down_y可能会超出绘图区域，过滤掉超出的部分\n",
    "    up_index = (up_y >= axis[2]) & (up_y <= axis[3])\n",
    "    down_index = (down_y >= axis[2]) & (down_y <= axis[3])\n",
    "    \n",
    "    plt.plot(plot_x[up_index], up_y[up_index], color='black')\n",
    "    plt.plot(plot_x[down_index], down_y[down_index], color='black')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "# 数据归一化\n",
    "standardScaler = StandardScaler()\n",
    "standardScaler.fit(X)\n",
    "X_standard = standardScaler.transform(X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用scikit-learn中的svm训练模型进行分类"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "将正则化项前面的系数设置为一个很大的数，令正则化项在模型训练的过程中被置为0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearSVC(C=1000000000.0, class_weight=None, dual=True, fit_intercept=True,\n",
       "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
       "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
       "     verbose=0)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.svm import LinearSVC\n",
    "\n",
    "svc = LinearSVC(C=1e9)\n",
    "svc.fit(X_standard, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xt8zvX/x/HH2xxm5BwJoaOk41Q6q80xx6IQX5XINtuYw8acbc6G2QEhhUhEzoc5VCqV9VUU9ZXIHBoyp81hu96/P9BPhevz+eyza9d17XW/3dxu7XK935/3Z+PZx+d6Xu9Laa0RQgjhPQrl9wKEEELYS4JdCCG8jAS7EEJ4GQl2IYTwMhLsQgjhZSTYhRDCy+Q62JVSvkqpb5RS3yulflRKDbNjYUIIIaxRue2xK6UUUEJrfUYpVQTYAoRrrbfasUAhhBDmFM7tBPrS/xnOXP6yyOVf8q4nIYTIJ7kOdgCllA+QCtwJJGqtv77Gc7oB3QBKFC/uX6tGDTsOLYTIR0dPnMC3aFFuKlHC9NhM/PJgRd5t167UY1rrm509L9e3Yv42mVJlgCVAqNZ65/WeV7d2bb1tzhzbjiuEcL1Zn3xClxEjaNewIfNHjjQ1NhV/U8/Pzr5IdHQHnn++NY0bdzA11pvUratStdZ1nT3P1laM1joD2Aw0tnNeIYR7mb9mDW/FxNDoiSeYPXSoqbFmQz0nJ4fBg//Dhg2LOHnyT1NjCyo7WjE3X75SRylVHAgEdud2XiGEe1q6eTOdhgzhmYcf5uNx4yhWtKjhsWZD3eFwEBvbjXXrFhAaOoZXX+1hdrkFkh332CsD712+z14IWKi1XmHDvEIIN7P2q694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appRqrJT6WSm1RykVld/rsZNSapZSKl0p5ZXvH1FKVVNKbVJK7br8Z9NrNl9SSvkqpb5RSn1/+dyGOR2TX/fYlVKlrrxzVSkVBtTWWht98dWtKaUaAhu11tlKqTEAWuvIfF6WbZRS93LpBfNpQB+t9bZ8XlKuKaV8gF+ABkAa8C3QXmv9U74uzCZKqWeBM8D7Wmuv+2R0pVRloLLW+jul1E1AKtDKG35+6tLb00torc8opYoAW4BwrfXW643Jtyt2b9iO4Hq01uu01tmXv9wKVM3P9dhNa71La/1zfq/DZo8Be7TWe7XWF4AFQMt8XpNttNafAX/m9zryitb6sNb6u8v/fRrYBVTJ31XZQ19y5vKXRS7/umFe5us9dqVUrFLqAPAaHrqBmAFvAqvzexHCqSrAgau+TsNLgqGgUUrVAB4Gvs7fldhHKeWjlNoOpAPrtdY3PLc8DXalVIpSauc1frUE0FpHa62rAfOAHnm5Frs5O7fLz4kGsrl0fh7FyPl5mWvtxuY1/4osKJRSJYHFQM9/3BXwaFrrnMu76FYFHlNK3fB2Wp5+5qk3b0fg7NyUUp2BZkCA9sA3C5j42XmLNKDaVV9XBQ7l01qEBZfvPy8G5mmtP87v9eQFrXWGUmoz0JgbbKSYn60Yr92OQCnVGIgEWmitM/N7PcKQb4G7lFI1lVJFgXbAsnxekzDo8guMM4FdWuu4/F6PnZRSN19p1imligOBOMnL/GzFLAb+th2B1vpgvizGZkqpPUAx4Pjlh7Z6S+MHQCnVGpgC3AxkANu11o3yd1W5p5RqCkwCfIBZWuvYfF6SbZRS84H6XNrW9g9giNZ6Zr4uykZKqaeBz4EdXMoUgAFa61X5typ7KKUeAN7j0p/LQsBCrfXwG47xwLsEQgghbkDeeSqEEF5Ggl0IIbyMBLsQQngZCXYhhPAyEuxCCOFlJNiFEMLLSLALIYSX+T/A4BjrsITU0AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_svc_decision_boundary(svc, axis=[-3, 3, -3, 3])\n",
    "plt.scatter(X_standard[y == 0, 0], X_standard[y == 0, 1])\n",
    "plt.scatter(X_standard[y == 1, 0], X_standard[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "调节正则化项前面的系数，降低正则化项的在目标函数中的比重，给模型更大容错空间"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearSVC(C=0.01, class_weight=None, dual=True, fit_intercept=True,\n",
       "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
       "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
       "     verbose=0)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc2 = LinearSVC(C=0.01)\n",
    "svc2.fit(X_standard, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xd4VVXWx/HvJpQEZIYZARGQNo4gAxZgGEZ8rehgG3Us9KaINAXpiCQkdOkgLVSJlIAFC0pT7IIQRQgCNroiHYQkhCT7/SMJhpjk3uTue09bn+fheczl5px1QrI8Oee39lFaa4QQQrhHMasLEEIIYZY0diGEc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Ie07TWO7XWu62uw7DGwA9a65+01qnAMuBBi2syRmv9MXDC6jqCRWv9i9b6q6z//g3YCVSxtiozdKazWR+WyPpTYL+09Bq7UmqkUuoA0IbMBcTc6AngPauLED5VAQ7k+PggLmkMXqOUqgHcCGyythJzlFJhSqmtwBFgnda6wGMLamNXSq1XSiXm8edBAK31EK31VcBioGcwazHN17FlvWcIkEbm8TmKP8fnMnk9W881v0V6hVLqMuA1oHeuqwKOprVO11rfQOZv/42VUgVeTgvqgzbcvByBr2NTSnUA7gfu1A4cFijEv51bHASuyvFxVeBni2oRRZB1/fk1YLHW+nWr6wkGrfUppdSHQHMKWEjRylSMa5cjUEo1BwYC/9VaJ1ldj/DLZuDvSqmaSqmSQEvgLYtrEn7KusE4D9iptZ5odT0mKaUqZCfrlFIRQDN89EsrUzGvAZcsR6C1PmRJMYYppX4ASgHHs17a6JbED4BS6mFgGlABOAVs1Vr/x9qqAqeUuheYDIQB87XWIy0uyRil1FLgNjKXtf0ViNJaz7O0KIOUUjcDnwDbyewpAM9rrd+1riozlFLXAS+T+X1ZDFiutY4p8HMceJVACCFEAWTyVAghXEYauxBCuIw0diGEcBlp7EII4TLS2IUQwmWksQshhMtIYxdCCJf5f4JAJ/+Ke7AzAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_svc_decision_boundary(svc2, axis=[-3, 3, -3, 3])\n",
    "plt.scatter(X_standard[y == 0, 0], X_standard[y == 0, 1])\n",
    "plt.scatter(X_standard[y == 1, 0], X_standard[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 4.03238087, -2.50699881]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.92733298])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc.intercept_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SVM中使用多项式特征"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 准备数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "X, y = datasets.make_moons()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 2)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100,)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD8CAYAAACfF6SlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAHiNJREFUeJzt3X+QHOV95/H3V6sVLIetBWttw0qK5GRtBwO2zBa2o6s7bAEWVIGI7GDw+Qw5E5Uvxfkud8dZlF3YpZRLIuSOhDLnROc4BicGZJsTcpBPjiW43LkOjiXil8ACWTHRrihrA0gXzBok8b0/pgdmZ7tnZ3Z6up/u/ryqVDs/Hk0/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e53xxTp+WdSxWGfh4ARM1tuZguoTTgGkykT2QZcFd2+Cpjxi8bMTjGzE6Lbi4CVwJOZ1TBZO+9v4/59HNjl0SxXQGbdj6Yx2Eupjd0W0Tbg01GGyQeBI/VhxyIxs7fX547M7Fxq8e351v8re1Ed/wx4yt3/S0Kx3n8mec98pzyL/pvUvjFfAX4O7IgePx3Y3jST/jS1o+Qv5F3vmP14C7ATeCb6e2r0+Cjw9ej2bwCPU8tCeRz4TN71bvX+AhuAS6PbJwLfAfYB/xd4R951nuN+bAT2RJ/BfcC7865zwn7cATwHHI36x2eAzwKfjZ434NZoPx8nIVMu739t7Me1DZ/HA8Bv5F3nhP34p9SGcB4DHon+XZz1Z6IzfEVEKqiKwz4iIpWn4C8iUkEK/iIiFaTgLyJSQQr+IiIVpOAvIlJBCv4iIhWk4C8iUkH/H6gBuXR8jhTiAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "为数据集加入一些扰动"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "X, y = datasets.make_moons(noise=0.15, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3X/QZFV95/H3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7OCR53y9dExEvADsAg4tpXT7yvv/+56s2eBGScvLKdrxKTQ3AAACPUlEQVRQUvq85vUbkn4i6XuS3lB1YeZlTZwnA3e17arjOfbSns0k3Qa8psOuj0fEt/L8ig7bxpb21au8A/yamYjYLukYYKOkzRHxaDEl7CvP+Sr1nPaRpyzfBq6LiOckXUqjtpPq2uYpnds8/oHGlA6/kvQu4Cbg2IrLhKRXAF8H/ntE/Ev77g5vSfkcAw4MLSLizBF/xVag+Q5xGbB9xN/ZVa/ySvqFpCMiYkdWdX2yy+/Ynv18TNIdNO56ygoMec7X/DFbJe0PLKa65oa+5Y2IXza9/CLw6RLKNaxSP6+jar7oRsTNkv5C0mERUdmcRJIW0ggKfxMR3+hwSK3O8Tw3JRXrbuBYSUdLOoBGZ2npmT6Z9cDK7PlKYJ8aj6SDJR2YPT8MOBV4sLQS5jtfzf+O9wIbI+vVq0Df8ra1H59Ho905VeuB92eZM28Fds03P6ZI0mvm+5cknULj+vXL3u8aa3kEfAl4KCL+rMthtTrHL6m697suD+A/0Yj+zwG/AG7Jth8J3Nx03LtoZCc8SqMJqqryHgpsAB7Jfh6SbZ8Frs6evw3YTCO7ZjNwcQXl3Od8AWuA87LnBwF/B2wB/h44puLPQb/yfgp4IDuntwOvq7Cs1wE7gD3ZZ/di4FLg0my/gM9n/5bNdMm2S6i8H2o6t3cCb6u4vL9Jo1loE3Bf9nhXyuc478Mjn83MrIWbkszMrIUDg5mZtXBgMDOzFg4MZmbWwoHBzMxaODCYmVkLBwYzM2vhwGBmZi3+P0fgkUloMjyPAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用多项式特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import PolynomialFeatures, StandardScaler\n",
    "from sklearn.svm import LinearSVC\n",
    "from sklearn.pipeline import Pipeline\n",
    "\n",
    "def PolynomialSVC(degree, C=1.0):\n",
    "    return Pipeline([\n",
    "        (\"poly\", PolynomialFeatures(degree=degree)),\n",
    "        (\"std_scaler\", StandardScaler()),\n",
    "        (\"linearSVC\", LinearSVC(C=C))\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('poly', PolynomialFeatures(degree=3, include_bias=True, interaction_only=False)), ('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('linearSVC', LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,\n",
       "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
       "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
       "     verbose=0))])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_svc = PolynomialSVC(degree=3)\n",
    "poly_svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQ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neTqh9Ff+fELL6Ky/nJvmv5BPCrFZRprjqBAAAAR0lEQVTxX9Dt/tkLPBV9XR/a9UxZzszXU0tXiIgIULMuIxERKY8CgoiIAAoIIiISUUAQERFAAUFERCIKCCIiAiggiIhI5P8DHQ5vhcHLOBwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用多项式核函数的SVM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC\n",
    "\n",
    "def PolynomialKernelSVC(degree, C=1.0):\n",
    "    return Pipeline([\n",
    "        (\"std_scaler\", StandardScaler()),\n",
    "        (\"kernelSVC\", SVC(kernel=\"poly\"))\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('kernelSVC', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma='auto_deprecated',\n",
       "  kernel='poly', max_iter=-1, probability=False, random_state=None,\n",
       "  shrinking=True, tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_kernel_svc = PolynomialKernelSVC(degree=3)\n",
    "poly_kernel_svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAH6xJREFUeJzt3X+MHOWd5/H314NxZsISHAwLjJ2B7CG8XgclzIgk65OFdn2rBA7w3hKOBGnJCeRwdxH3Yw8FdBJ7QieRbHS/OLLHekm0ScQlAfaOJWdWJISNfMqJLAwHZohh47DxMTYb88NArBnZZvzcH11t97Sruqu6nqp6qurzkkbu6a7pelzTU996nuf7fMucc4iIiKyougEiIhIGBQQREQEUEEREJKKAICIigAKCiIhEFBBERATwFBDM7GtmdsDM5hJev8zM3jazZ6OvO3zsV0RE/DnF0/v8GXAP8I0B2/xv59w/9LQ/ERHxzEsPwTm3E3jTx3uJiEg1fPUQ0vi4mT0H7Af+jXPuhf4NzGwbsA3gvePj0+vPP7/E5omI1N/s7t2vO+fOGuVnywoIzwBTzrlDZnY58DBwYf9GzrntwHaAmQ0b3NPf/GZJzRMRaQabmdk76s+WkmXknHvHOXcoevwosNLM1pSxbxERSaeUgGBm55iZRY8vjfb7Rhn7FhGRdLwMGZnZt4DLgDVmNg/8IbASwDl3L3AN8E/N7F1gEbjOqcyqiEhQvAQE59ynh7x+D520VBERCZRWKouICKCAICIiEQUEEREBFBBERCSigCAiIoACgoiIRBQQREQEUEAQEZGIAoKIiAAKCCIiElFAEBERQAFBREQiCggiIgIoIIiISKTMeypLgz28d4Evzx1i/8IxzptYwa0bT2Pr1ETVzRKRDBQQJLeH9y5w++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1ma2KHq8BNlFOWfI0x6e3/dcAT7hopqxEQ9vZN3Z8FZ2x3NA8Avx+lB3zMeDt7nBiSMzsnO48kZldSuf89Mbgn/LeBgO+Cux2zv3HhM0qP55p2jnS8Sx7dnzArPnv0om8h4FfAI9Fz58HPBo9/iCdTI/ngBfoDOEE1053IhPhb+hcbVfRzjOBHwA/jf59f/T8DHBf9Pg3geej4/k8cGOJ7Tvp+AB3AldFj98DPAjsAf4a+GBFn8th7bwr+iw+B/wVsL6CNn4LeBU4Gn02bwRuBm6OXjc6N6n6WfR7Tsziq7idn+85lk8Cv1lBG/8+neGfXcCz0dfloR3PlO3MfDxVukJERICaDRmJiEhxFBBERARQQBARkYgCgoiIAAoIIiISUUAQERFAAUFERCL/Hw8DoZ4UGZEVAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_kernel_svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用scikit-learn中的高斯核函数（RBF）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "def RBFKernelSVC(gamma=1.0):\n",
    "    return Pipeline([\n",
    "        (\"std_scaler\", StandardScaler()),\n",
    "        (\"kernelSVC\", SVC(kernel=\"rbf\", gamma=gamma))\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('kernelSVC', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=1.0, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc = RBFKernelSVC(gamma=1.0)\n",
    "svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3W2MHdV5B/D/sxvb2Q0BLxjHsOvYpkV1XNdKfFfkxVWEghvxUrDTBBfyIVCBLNog95UWVMlJ/YVQlKpCJKXOiwKoJRjaOqZASEyCaKkg+LrGLLFJDMT12k7My9rE8so266cf7lxzfT1z78ydM+ecOfP/SSvv3p3dOb577zznOec5Z0RVQURE1Oe6AURE5AcGBCIiAsCAQEREEQYEIiICwIBAREQRBgQiIgJgKCCIyLdF5ICIjCV8/2IROSQi26KPtSbOS0RE5rzH0O/5DoC7AdzX4Zj/UtXfN3Q+IiIyzEiGoKpPA3jLxO8iIiI3TGUIaXxcRF4AsA/AX6nqS+0HiMhqAKsB4H0DA7WF8+dbbB4RVdkRDLpughE7dtTfUNVze/lZWwFhK4B5qnpYRC4HsBHAhe0Hqep6AOsBYHTRIt1y//2WmkdEVVZHzXUTjBkdld29/qyVKiNVfVtVD0efPwZgmojMsnF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Y1ofF5EXRORxEfltlw2Jhik/AuC5tm959Xx2aCeQ8fm0sZfRSQa2wQCAZaq6T0RmA/ihiOyMeh7G2NyuI49O7czwaz4YPZ8XAPiRiLyoqq+YaWGiNM+PleewizRteATAA6p6VERuQiOr+VThLcvGh+cyja0A5qnqYRG5HMBGABe6aIiInAHg3wD8maq+3f7tmB9x8nx2aWfm59NqQND822BAVfdF/x4Qkf9AI603GhAMtNPKdh2d2ikivxKR81R1f5TOHkj4Hc3n81UReQqNnkbRASHN89M8ZlxE3gPgLNgfbujaTlV9s+XLbwC4w0K7sirF9jGtFzRVfUxEvi4is1TV6oZyIjINjYvsv6jqv8cc4sXz2a2dvTyfpRoyEpH3icj7m58D+DQa92TwjQ/bdWwCcF30+XUATstsRGRIRGZEn88CsAx2tiVP8/y0tv9zAH6k0UyZRV3b2TZ2fBUaY7m+2QTgC1F1zMcAHGoOJ/pEROY054lE5CI0rk9vdv4p420QAN8CsENV/yHhMOfPZ5p29vR82p4d7zBr/hk0Iu9RAL8C8ET0+PkAHos+vwCNSo8XALyExhCOd+3UdysRfoZGb9tFO88B8CSAn0f/nh09Pgrgm9HnnwDwYvR8vgjgBovtO+35AbAOwFXR5+8F8BCAXQB+AuDY5AxiAAAAg0lEQVQCR6/Lbu28PXotvgDgxwAWOmjjAwD2AzgevTZvAHATgJui7wsaN6l6Jfo7J1bxOW7nzS3P5bMAPuGgjb+LxvDPdgDboo/LfXs+U7Yz8/PJrSuIiAhAyYaMiIioOAwIREQEgAGBiIgiDAhERASAAYGIiCIMCEREBIABgYiIIv8PUuWUKjoYMAQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "增大gamma的值，查看RBF核函数训练出来的模型的分类特点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('kernelSVC', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=100, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc = RBFKernelSVC(gamma=100)\n",
    "svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3W2MHdV5B/D/4/VL1nESGxwHsB0DLarjbiPCXZEXqgo1bkQgYNIECvkQqEAr2iJatUUhquSk/pKkSFUbJWm6eVEIagmGtsQEIhInQamooPhaBpYYEkNCWdvEvKwhli1s7Kcf7tz13bvzcs6cMzNnZv4/yfLu3dl7z96Xeeac85zniKqCiIhoQdUNICKiMDAgEBERAAYEIiKKMCAQEREABgQiIoowIBAREQBPAUFE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RGSHiDwsImUFDZPnZ/YY7aUuvwrg1FJaF9OGSNLr+LFo6OBuEVkb8/OqhfB+NPV+EXlMRL4vIr9bZUOiYcr3AHhk6EdBPZ8p7QQsn88yahnN8lAGAwAuUNV9IrIKwA9F5KnoysObMst1uEhrp8XdvDN6Ps8G8GMReUJVn/HTwkQmz08pz2EGkzbcC+AOVX1dRG5Ar1fzh4W3zE4Iz6WJnQDWqeohEbkYwD0AzqmiISKyDMB/APgrVX1t+Mcxv1LJ85nRTuvns9SAoO5lMKCq+6L/D4jIf6HXrfcaEDy0s5RyHWntFJFfi8jpqro/6s4eSLiP/vP5rIg8iN6VRtEBweT56R8zLSILAbwN5Q83ZLZTVV8e+PZrAL5QQrts1aJ8zOAJTVXvF5GviMhKVS21oJyILELvJPtvqvqfMYcE8XxmtTPP81mrISMRebOIvKX/NYAPobcnQ2hCKNexDcA10dfXAJjXsxGRFSKyJPp6JYALUE5ZcpPnZ7D9HwfwY41mykqU2c6hsePL0BvLDc02AJ+MsmPeB+DV/nBiSETktP48kYicj9756eX03/LeBgHwDQC7VfUfEw6r/Pk0aWeu57Ps2fGUWfOPohd5XwfwawAPRLefAeD+6Ouz0cv0eAzAk+gN4QTXTj2ZifBz9K62q2jnqQB+BOAX0f+nRLePA/h69PUHADwRPZ9PALiuxPbNe34AbAFwWfT1mwDcBWAPgP8FcHZF78usdn4uei8+BuAnANZX0MY7AOwHcCx6b14H4AYAN0Q/F/Q2qXomep0Ts/gqbueNA8/lwwA+UEEbfx+94Z/HAeyK/l0c2vNp2E7r55OlK4iICEDNhoyIiKg4DAhERASAAYGIiCIMCEREBIABgYiIIgwIREQEgAGBiIgi/w8dQgvbRdImLwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "减小gamma的值，查看RBF核函数训练出来的模型的分类特点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('kernelSVC', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=10, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc = RBFKernelSVC(gamma=10)\n",
    "svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3X+MHOV5B/Dv48N27DjgI8Yx2I6BFpVcXUTYE4HQVqixUn4UTJpgQf4IVKATbRBtlaIQVSIp/5AUqY1QkqZugkKslmBoS0whJXESREUFwWsZc8aQGIjrsw0GfIZYtmxjP/1jZ89765nZ+fHOvD/m+5FO3tub3Xk9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OuNBgQD5axluY60corIGyJyuqrujpqzexLeo3s8XxWRJ9GpaVQdELIcn+42EyJyEoBTUH93w8ByqurbPb/+C4Cv1VCuvLxYPqb3gqaqj4vIt0RkgarWuqCciMxE5yL7r6r6HzGbOHE8B5WzyPH0qstIRN4vIh/oPgbwSXTuyeAaF5brWAfghujxDQBOaNmIyLCIzI4eLwBwCepZljzL8ekt/2cA/EyjkbIaDSxnX9/x1ej05bpmHYDPRdkxFwF4p9ud6BIRWdQdJxKRC9G5Pr2d/irjZRAA3wWwVVX/IWEz68czSzkLHc+6R8dTRs0/hU7kPQTgDQBPRM+fAeDx6PHZ6GR6PA9gCzpdOM6VU49nIvwSndq2jXJ+EMBPAfwq+vfU6PlRAN+JHn8cwAvR8XwBwE01lu+E4wPgLgBXR4/fB+AhANsA/ALA2ZbOy0HlvDs6F58H8HMA51oo4wMAdgM4Ep2bNwG4BcAt0d8FnZtUvRJ9zolZfJbLeWvPsXwGwMctlPH30en+2QxgU/RzhWvHM2M5cx9PLl1BREQAPOsyIiKi6jAgEBERAAYEIiKKMCAQEREABgQiIoowIBAREQAGBCIiivw/R3v8CT2j7GwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "继续减小gamma的值，查看RBF核函数训练出来的模型的分类特点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('kernelSVC', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=0.5, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc = RBFKernelSVC(gamma=0.5)\n",
    "svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3X+sHeV95/H31xfjXIcmOBjX4GsM2SJcrxMlnCuS1CuEGjdKYINpG1hSpJIqyGV3I7bd3ahUK7ldpFWaRl2tEOlSN42aoCwJyW6pWeiSkDRixYoEDgJzCZA4tF5fm8T8ML/ku8a+fvaPM+dy7vHMOTNnnpl5Zubzkq587ty5Zx7PnTPf58f3ecacc4iIiKyougAiIhIGBQQREQEUEEREJKKAICIigAKCiIhEFBBERATwFBDM7MtmdtjM5hJ+fpmZvWpmj0dfu3wcV0RE/DnN0/v8NXAb8NUR+/xv59w/93Q8ERHxzEsLwTn3IPCyj/cSEZFq+GohpPEhM3sCOAT8e+fcU8M7mNlOYCfA26enO5vPP7/E4olIWY6yuuoiNNbTT3dfdM6dPcnvlhUQHgM2OefeMLPLgbuBC4d3cs7tBnYDzG7Z4h69446Siicipep06XZ3Vl2KRpqd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YjiluvI/cfK6Bedc89D7+IB1iXs9zYze9TMHjazsoJGmvOztI/rpS6/CpxVSuliyhBJ+jv+ZtR18C0z2xjz86qFcD2m9SEze8LM/s7M/mmVBYm6Kd8P/GDoR0GdzxHlhIzns9TnIXhYBgNgm3PukJmtA75jZs9ENQ9vylyuI49R5czwNudF5/PdwPfM7Enn3E/9lDBRmvNTyjkcI00Z7gHudM4dM7Mb6bVqfrXwkmUTwrlM4zFgk3PuDTO7HLgbuLCKgpjZGcB/B37POffa8I9jfqWS8zmmnJnPZ6kBweVfBgPn3KHo38Nm9jf0mvVeA4KHcpayXMeocprZz83sHOfc81Fz9nDCe/TP53Nm9n16NY2iA0Ka89PfZ97MTgPeSfndDWPL6Zx7aeDbvwQ+X0K5sqrF8jGDNzTn3H1m9udmttY5V+qCcma2kt5N9mvOuf8Rs0sQ53NcOSc5n7XqMjKzt5vZL/RfAx+h90yG0ISwXMce4Pro9fXAKS0bM1tjZqui12uBbRS9LHlPmvMzWP5PAN9z0UhZicaWc6jv+Ep6fbmh2QP8dpQd80Hg1X53YkjMbH1/nMjMLqF3f3pp9G95L4MBfwU87Zz7zwm7VX4+05RzovNZ9uj4iFHzX6cXeY8BPwfuj7afC9wXvX43vUzPcpbDAAAAwUlEQVSPJ4Cn6HXhBFdO91Ymwo/p1barKOdZwHeBn0T/vivaPgt8KXr9K8CT0fl8Evh0ieU75fwAtwBXRq/fBnwT2Af8EHh3RdfluHJ+LroWnwD+HthcQRnvBJ4HjkfX5qeBG4Ebo58bvYdU/TT6Oydm8VVczs8MnMuHgV+poIz/jF73z17g8ejr8tDOZ8pyZj6fWrpCRESAmnUZiYhIcRQQREQEUEAQEZGIAoKIiAAKCCIiElFAEBERQAFBREQi/x8OpNJvlxQr7QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "继续减小gamma的值，查看RBF核函数训练出来的模型的分类特点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('kernelSVC', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=0.1, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc = RBFKernelSVC(gamma=0.1)\n",
    "svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\CandyWall\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:1000: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3X+MH/Wd3/Hn24txdsMRHIwP2HUMtAif66CEXZHkqCLUuNeENJjrEUqCdKQKsmgb0atSFE6VuKulisuhVBUlLfXl0CUoSmLSO84pnLg4uYgqLQleBGYJ5mLouV6bZPlh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ICIigAKCiIhEFBBERARQQBARkYgCgoiIAAoIIiIS+f+7rtXADO+goQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1])\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 直观理解高斯核函数(RBF)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-4, -3, -2, -1,  0,  1,  2,  3,  4])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = np.arange(-4, 5, 1)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 1, 1, 1, 1, 1, 0, 0])"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = np.array((x >= -2) & (x <= 2), dtype='int')\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAD8CAYAAABkbJM/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAE9VJREFUeJzt3X+wXPV93vH3UwkIcQPmh3BAgoopiqfEcUmyI7vjacc1BmTXg0hLamXcRJniUZMx43TaOIUyMVRuOmCm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AW+t/BpiHS/23tNuDJqvpPk84zL8ma+asAk5wMvJ0peB1W1bVVta77mbUFeOBolQVYGMeLG5M8luQR+m+ZTcWlhsAtwI8Bu7pLfv/LpAMBJPm57jvK/h7wR0l2TipLd1HA1fS/hPNJ4O6qenxSeeYl+X3gi8Dru+9xu2rSmTpvAX4ReNvAP9H8zkmHAs4GvtC9BnfTP4dxVC9hnUZ+0luS1MQjDElSEwtDktTEwpAkNbEwJElNLAxJUhMLQ5LUxMKQJDWxMCRJTf4f/hu4N65yoy8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x[y == 0], [0] * len(x[y == 0]))\n",
    "plt.scatter(x[y == 1], [0] * len(x[y == 1]) )\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "def gaussian(x, l):\n",
    "    gamma = 1.0\n",
    "    return np.exp(-gamma * (x - l) ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "l1, l2 = -1, 1\n",
    "\n",
    "x_new = np.empty((len(x), 2))\n",
    "for i, data in enumerate(x):\n",
    "    x_new[i, 0] = gaussian(data, l1)\n",
    "    x_new[i, 1] = gaussian(data, l2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAELxJREFUeJzt3X+s3XV9x/Hny7Zol2G72ZpoWy1uxdggCeaGY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W1pqo2VtVGeu8xbK2q6cm0OxJdfqbvoPfGOUnW0LtMc3BRuxydLvP9GXAxQJK30Av32UXtcnHtAd7X/9TMBcDhqvr5yPY+6XeUh3jn+VLgf+i94/7x/thOer/k0PtB+BpwAPhv4E2T7nnM8/1P4P+AH/T/7Jl0z+Oc77za77DEPy3T8RgH+CfgUeBh4IpJ9zzm+W4GvkfvkzQ/AP580j2f5Hy/AvwcOErvLP0q4IPAB+cc39v6/x4Pj/pn2jtUJalBS+WyjCRpCIa7JDXIcJekBhnuktQgw12SGmS4S1KDDHdJapDhLkkN+n/fUuPv2PVpmAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x_new[y == 0, 0], x_new[y == 0, 1])\n",
    "plt.scatter(x_new[y == 1, 0], x_new[y == 1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# svm思想解决回归问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "boston = datasets.load_boston()\n",
    "X = boston.data\n",
    "y = boston.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import LinearSVR\n",
    "from sklearn.svm import SVR\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.pipeline import Pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [],
   "source": [
    "def StandardLinearSVR(epsilon=0.1):\n",
    "    return Pipeline([\n",
    "        (\"std_scaler\", StandardScaler()),\n",
    "        (\"linearSVR\", LinearSVR(epsilon=epsilon))\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('linearSVR', LinearSVR(C=1.0, dual=True, epsilon=0.1, fit_intercept=True,\n",
       "     intercept_scaling=1.0, loss='epsilon_insensitive', max_iter=1000,\n",
       "     random_state=None, tol=0.0001, verbose=0))])"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svr = StandardLinearSVR()\n",
    "svr.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6354968234847989"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svr.score(X_test, y_test)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "176px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
